package com.bckj.fastboot.flowable.model;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@JsonTypeInfo(
        use = JsonTypeInfo.Id.NAME,
        defaultImpl = ProcElement.class,
        visible = true,
        property = "type"  // JSON中标识类型的字段
)
@JsonSubTypes({
        @JsonSubTypes.Type(value = ProcStartEvent.class, name = "startEvent"),
        @JsonSubTypes.Type(value = ProcEndEvent.class, name = "endEvent"),
        @JsonSubTypes.Type(value = ProcUserTask.class, name = "userTask"),
        @JsonSubTypes.Type(value = ProcServiceTask.class, name = "serviceTask"),
        @JsonSubTypes.Type(value = ProcExclusiveGateway.class, name = "exclusiveGateway"),
        @JsonSubTypes.Type(value = ProcParallelGateway.class, name = "parallelGateway"),
        @JsonSubTypes.Type(value = ProcCallActivity.class, name = "callActivity")
})
public class ProcElement {
    private String bizId;
    private String type;
    private String name;
}
